@include('admin._include.header')

<body>

<div class="layui-fluid">
    <div class="larry-container">
            <div class="layui-col-xs12 layui-col-sm12 layui-col-md12 layui-col-lg12">
                <table lay-filter="ad_table" class="layui-table" lay-data="{height:'full-155',cellMinWidth:95,url:'{{url('user/balance-log').'/'.$uid}}', page:true, id:'ad_table',defaultToolbar:[]}">
                    <thead>
                    <tr>
                        <th lay-data="{field:'type_string',align:'center'}">类型</th>
                        <th lay-data="{field:'amount',align:'center'}">金额</th>
                        <th lay-data="{field:'msg',align:'center'}">变动描述</th>
                        <th lay-data="{field:'create_at',align:'center'}">创建时间</th>
                    </tr>
                    </thead>
                </table>
            </div>
    </div>
</div>



<script>
    layui.config({
        base: "/plugin/layuiadmin/"  //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table'], function(){
        var $ = layui.$,
            form = layui.form,
            table = layui.table;

        table.on('tool(ad_table)', function(obj){
            var data = obj.data;
            var that = this;
            var url = $(this).data('url');

            switch (obj.event) {
                case "show":
                    var arr = [];
                    var obj = {
                        'alt':data.avatar,
                        'pic':data.id+"_id",
                        'src':data.avatar,
                        'thumb':data.avatar
                    };
                    arr.push(obj);
                    var json = {
                        'title':data.avatar,
                        'id':data.id,
                        'start':0,
                        'data':arr
                    };
                    layer.photos({
                        photos: json
                        ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
                    });
                    break;

                case 'edit':
                    var index = layer.open({
                        title: data.title,
                        type: 2,
                        area: ['760px', '550px'],
                        content: url,
                        end: function() {
                            $(that).removeAttr("data-flag");
                            layui.cache.layerIndex = null;
                            table.reload('ad_table')
                        }
                    });
                    layer.full(index);
                    break;

                default:
                    break;

            }

        });

    });

</script>

</body>

@include('admin._include.footer')


